class Solution:
    def minCostClimbingStairs(self, cost):
        total={}
        total[0],total[1]=0,0
        for i in range(2,len(cost)+1):
            t1=total[i-1]+cost[i-1]
            t2=total[i-2]+cost[i-2]
            total[i]=min(t1,t2)
        return total[len(cost)]
